<template>
<div class="zhtt-border-box">
  <h3>demo16-provide-inject-demo07-children.vue</h3>
  location：{{userLocation}}<br/>
  geolocation：{{userGeolocation}}<br/>
  <button class="zhtt-btn" @click="updateLocation">更新location</button>
</div>
</template>

<script>
import { inject } from 'vue';
export default {
  setup() {
    const userLocation = inject('location', '默认值！');
    const userGeolocation = inject('geolocation', '默认值！');
    const updateLocation = inject('updateLocation')
    return {
      userLocation,
      userGeolocation,
      updateLocation
    }
  }
}
</script>
